Skip to content

Conversation

@knd0331
Copy link

@knd0331 knd0331 commented Dec 10, 2025

…_img2img.py

The training script incorrectly accessed Flux2ImageProcessor.image_processor which doesn't exist as a class attribute, causing AttributeError when running Flux2 img2img DreamBooth training.

Changes:

  • Initialize Flux2ImageProcessor instance in DreamBoothDataset.init
  • Replace incorrect class attribute access with instance method calls

Fixes #12778

What does this PR do?

Title:
Fix Flux2ImageProcessor AttributeError in train_dreambooth_lora_flux2_img2img.py

Body:

Summary

Fix AttributeError: type object 'Flux2ImageProcessor' has no attribute 'image_processor' when
running Flux2 img2img DreamBooth training script.

Problem

The training script incorrectly accesses Flux2ImageProcessor.image_processor which doesn't exist as
a class attribute.

Solution

Initialize Flux2ImageProcessor instance in DreamBoothDataset.__init__ and use instance methods.

Changes

  • Initialize Flux2ImageProcessor instance in DreamBoothDataset.__init__
  • Replace incorrect class attribute access with instance method calls

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

…_img2img.py

The training script incorrectly accessed `Flux2ImageProcessor.image_processor`
which doesn't exist as a class attribute, causing AttributeError when running
Flux2 img2img DreamBooth training.

Changes:
- Initialize Flux2ImageProcessor instance in DreamBoothDataset.__init__
- Replace incorrect class attribute access with instance method calls

Fixes huggingface#12778
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Jan 9, 2026
@yiyixuxu
Copy link
Collaborator

I think this is already fixed!
let me know otherwise, we can re-open

@yiyixuxu yiyixuxu closed this Jan 10, 2026
@yiyixuxu yiyixuxu reopened this Jan 10, 2026
@yiyixuxu yiyixuxu closed this Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issues that haven't received updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: type object 'Flux2ImageProcessor' has no attribute 'image_processor'

2 participants